package site.shihuan.helpdesk.service.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import site.shihuan.helpdesk.common.model.JwtUser;
import site.shihuan.helpdesk.common.model.RestResult;
import site.shihuan.helpdesk.common.model.RestResultUtils;
import site.shihuan.helpdesk.security.context.UserContext;
import site.shihuan.helpdesk.service.exception.ServiceResultCode;
import site.shihuan.helpdesk.service.manager.MessageManager;

/**
 * 历史聊天API
 *
 * @author 周世焕
 * @Date 2021/3/4 13:35
 */
@RestController
@RequestMapping("/v1/service/message")
public class HistoryMsgController {

    @Autowired
    private MessageManager messageManager;

    @GetMapping("history")
    public RestResult findMsgHistory(String contactId,int start) {
        return RestResultUtils.success(messageManager.findMsgHistory(contactId, start));
    }
}
